package com.hw.core.system.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

@Entity
@Table(name = "user_notebook")
@Document(indexName="jwxt",type="notebook")
public class NoteBook implements Serializable{
  private static final long serialVersionUID = 5L;

  @Id
  @GeneratedValue
  private Integer id;
  private String name;

  private String img;
  @Column(name = "text" , columnDefinition = "TEXT" )

  private String text;

  @OneToOne
  @JoinColumn(name = "u_id")

  @NotFound(action= NotFoundAction.IGNORE)
  private User user;

  //为1所有人可见
  private Integer status;


  public Integer getStatus() {
    return status;
  }

  public void setStatus(Integer status) {
    this.status = status;
  }



  public NoteBook() {
  }
  public NoteBook(Integer id) {
    this.id=id;
  }


  public User getUser() {
    return user;
  }

  public void setUser(User user) {
    this.user = user;
  }
  public NoteBook(Integer id, String name, String pId) {
    this.id=id;
    this.name = name;
  }

  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getImg() {
    return img;
  }

  public void setImg(String img) {
    this.img = img;
  }

  public String getText() {
    return text;
  }

  public void setText(String text) {
    this.text = text;
  }
}
